In [39]:
from IPython.display import clear_output
from time import sleep
import serial
import os
import sys
In [41]:
import serial
ser = serial.Serial('/dev/tty.usbmodem1411', 9600) # Establish the connection on a specific port
ser.write('on')
Out[41]:
In [42]:
import serial
ser = serial.Serial('/dev/tty.usbmodem1411', 9600) # Establish the connection on a specific port
ser.write('off')
Out[42]:
In [43]:
import time, sys
import serial
ser = serial.Serial('/dev/tty.usbmodem1411', 57600) # Establish the connection on a specific port
for i in range(100):
ser.write('on')
time.sleep(0.4) #24Hz
ser.write('off')
time.sleep(0.4)
time.sleep(0.014) seems to be a lower limit
Works with: